The Access Key Manager provides the following functions for registering, getting, and removing access keys.
The QTGetAccessKeys function returns all the application and system access keys of a specified access key type.
pascal OSErr QTGetAccessKeys (
Str255 accessKeyType,
long flags,
QTAtomContainer *keys);
The QT atom container returned by this function contains atoms of type kAccessKeyAtomType at the top level. These atoms contain the keys. You can get the key values by using QT atom functions described in Movie Toolbox: New Features. In the QT atom container, application keys, which are more likely to be the ones an application needs, appear before system keys.
If there are no access keys of the specified type, the function returns an empty QT atom container.
When your application is done with the QT atom container, it must dispose of it by calling the QTDisposeAtomContainer function.
The QTRegisterAccessKey function registers an access key.
pascal OSErr QTRegisterAccessKey (
Str255 accessKeyType,
long flags,
Handle accessKey);
Most access keys are strings. A string stored in the accessKey handle does not include a trailing zero or leading length byte; to get the length of the string, get the size of the handle.
If the access key has already been registered, no error is returned, and the request is simply ignored.
The QTUnregisterAccessKey function removes a previously registered access key.
pascal OSErr QTUnregisterAccessKey (
Str255 accessKeyType,
long flags,
Handle accessKey);
| Previous | Chapter Contents | Chapter Top |